package cn.chainco.cts.iserviceImpl;

import java.util.Date;
import java.util.Map;

import cn.chainco.cts.idao.IExcRateDao;
import cn.chainco.cts.iservice.IExcRateManager;
import cn.chainco.cts.jdo.Currency;
import cn.chainco.cts.jdo.ExcRate;

public class ExcRateManagerImpl extends CommonManagerImpl implements IExcRateManager{
	private IExcRateDao excRateDao;

	public IExcRateDao getExcRateDao(){
		return excRateDao;
	}

	public void setExcRateDao(IExcRateDao excRateDao){
		this.excRateDao = excRateDao;
	}

	/**
	 * 得到所有币种对人民币的最新汇率
	 */
	public Map<Currency, Float> getAllCurrencyToRMB(){
		return this.excRateDao.getAllCurrencyToRMB();
	}
	
	/**
	 * 获取当天币种对人民币的汇率
	 */
	public ExcRate findByDateAndCurrency(final Date date, final Currency c){
		return this.excRateDao.findByDateAndCurrency(date, c);
	}
}
